<template>
    <view>
        <cmpt-comm-list
            type="my-foot"
            :search="search || ''"
            :_menus="sortMenus || []"
            :_items="sortItems || []"
            route="history/page"
            :isTotalMenu="false"
            topBottom="120"
            placeholder="搜索标题"
            returnUrl="/pages/my/foot/my_foot"
            @list="myCommListListener"
        >
            <!-- List Begin -->
            <view class="text-pic-list-box">
                <view class="item shadow item-simple" @tap="url" :data-url="item.path" v-for="(item, index) in dataList.list" :key="index">
                    <view class="simple">
                        <view class="simple-right">
                            <view class="simple-title content-cut-one">{{ item.relatedName }}</view>
                            <view class="simple-desc">
                                <text class="text-grey text-bold">{{ item.relatedTypeDesc }}</text>
                                <text class="margin-left-s">{{ item.visitTime }}</text>
                            </view>
                        </view>
                    </view>
                </view>

                <!-- load begin -->
                <!-- parse <template is="listLoadTpl" :data="skin:'load-project',dataList"/> -->
                <block name="listLoadTpl" v-if="true">
                    <view v-if="!dataList || (dataList && dataList.page < dataList.count)" :class="'load text-grey loading ' + 'text-grey'"></view>
                    <view v-if="dataList && dataList.page > 1 && dataList.page == dataList.count" :class="'load text-grey over ' + 'text-grey'"></view>

                    <block v-if="noHintImg">
                        <image style="height: 500rpx" mode="aspectFit" v-if="dataList && dataList.total == 0" :src="noHintImg" />
                    </block>

                    <block v-else>
                        <view v-if="dataList && dataList.total == 0" :class="'load text-grey ' + 'text-grey'">{{ '暂无记录' ? '暂无记录' : '暂无记录哦~' }}</view>
                    </block>

                    <view style="height: 200rpx"></view>
                </block>
                <!-- load end -->
            </view>
            <!-- List END -->
        </cmpt-comm-list>
    </view>
</template>

<script>
const behavior = require('@/utils/comm/behavior/my_foot_bh.js');
const ProjectBiz = require('@/utils/biz/project_biz.js');
const pageHelper = require('@/utils/helper/page_helper.js');
export default {
    data() {
        return {
            search: '',
            sortMenus: '',
            sortItems: '',

            dataList: {
                list: [],
                page: 0,
                count: 0,
                total: 0
            },

            noHintImg: ''
        };
    },
    mixins: [behavior],
    onReady: function () {
        ProjectBiz.initPage(this);
    },
    methods: {
        myCommListListener(e) {
            // 处理列表数据更新
            pageHelper.commListListener(this, e);
        },

        url(e) {
            pageHelper.url(e, this);
        }
    }
};
</script>
<style>
@import './my_foot.css';
</style>
